
            <h1>
              团购列表 
              <br/>
              <small>
                |---- 团购历史版本信息 ----
                <?php
                if($user == 'admin')
                  echo '|---- <a href="'. site_url('groupadmin/grouplist') . '">返回团购列表</a> ----|';
                if($user == 'store')
                  echo '|---- <a href="'. site_url('storeadmin/grouplist') . '">返回团购列表</a> ----|';
                ?>
              </small>
            </h1>
          </div>

          <div class="panel panel-default">
          
          <!-- Default panel contents -->
          <!--
          <div class="panel-heading">历史记录</div>
          -->

          <!-- Table -->
          <table class="table">
            <thead>
              <tr>
                <th>团购ID</th>
                <th>团购LOGO</th>
                <th>团购名称</th>
                <th>团购简介</th>
                <th>团购图片</th>
                <th>购买量</th>
                <th>购买人数</th>
                <th>购买有效期</th>
                <th>使用有效期</th>
                <th>状态</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
              <?php foreach ($grouplist as $question_item): ?>
                <tr>
                  <td><?php echo $question_item['group_id'] ;?></td>
                  <td>
                    <a href="<?php echo base_url($question_item['logo_pic']) ;?>">
                      <img src="<?php echo base_url($question_item['logo_pic']) ;?>" width="100" />
                    </a>
                  </td>
                  <td><?php echo $question_item['group_name'] ;?></td>
                  <td><?php echo $question_item['brief_des'] ;?></td>
                  <td>
                    <?php 
                      if($user == 'admin')
                        echo '<a href="' . site_url("groupadmin/picdetail?group_id=") . $question_item['group_id'] . '">查看</a>';
                      if($user == 'store')
                        echo '<a href="' . site_url("storeadmin/picdetail?group_id=") . $question_item['group_id'] . '">查看</a>';
                    ?>
                  </td>
                  <td><?php echo $question_item['this_buy_num'];?></td>
                  <td><?php echo $question_item['this_user_num'];?></td>
                  <td><?php echo $question_item['buy_deadline'] ;?></td>
                  <td><?php echo $question_item['use_deadline'] ;?></td>
                  <td>
                    <?php 
                      $state = $question_item['group_state'];
                      if($state == 1)
                        echo "出售中";
                      else if ($state == 2)
                        echo "超出购买期限";
                      else if($state == 3)
                        echo "超出使用期限";
                      else if($state ==4)
                        echo "已删除";
                      else if($state ==5)
                        echo "历史版本";
                      else
                        echo "状态异常";
                    ?>
                  </td>
                  <td>
                    <?php
                      if($user == 'admin')
                      {
                        echo "<a href='" . site_url("groupadmin/groupdetail?group_id=") . $question_item['group_id'] . "'>详情</a>/";
                        echo "<a href='" . site_url("groupadmin/groupversionhistory?group_id=") . $question_item['group_id'] . "'>相关订单</a>";
                      }
                      if($user == 'store')
                      {
                        echo "<a href='" . site_url("storeadmin/groupdetail?group_id=") . $question_item['group_id'] . "'>详情</a>/";
                        echo "<a href='" . site_url("storeadmin/groupversionhistory?group_id=") . $question_item['group_id'] . "'>相关订单</a>";
                      }
                    ?>
                  </td>
                </tr>
              <?php endforeach ?>
            </tbody>
          </table>
        </div>
